#include "record.h"
using namespace std;

// 重载item的<< 运算符
QDataStream &operator<<(QDataStream &stream, const record &item)
{
    return stream << item.rank << item.name << item.score;
}

// 重载item 的>> 运算符
QDataStream &operator>>(QDataStream &stream, record &item)
{
    return stream >> item.rank >> item.name >> item.score;
}

record::record(int rank, QString name, int score)
{
    this->name = name;
    this->rank = rank;
    this->score = score;
}
